<template>
    <div class="homeMain">
        <div class="swiper-container banan">
            <div class="swiper-wrapper">
                <div class="swiper-slide" v-for="(item,index) in 4" :key="index">
                    <img src="@/assets/img/banner1.png" alt="" />
                    <div class="banner-content">
                        <div class="banner-content-left">
                            <h2>一体式{{ index }}</h2>
                            <h1>超级平板显微镜</h1>
                            <p>具有测量，细胞就算等功能的软件安装 9.7英寸IPS Retina屏幕 | 分辨率2048*153</p>
                            <div class="banner-content-detail">
                                了解产品  <span>>></span>
                            </div>
                        </div>
                        <div class="banner-content-right">
                            <img src="@/assets/img/banner_1.png" alt="" />
                        </div>
                    </div>
                </div>
            </div>
            <div class="swiper-pag">
                <span :class="[index==swiperIndex?'pagActive':'']" v-for="(item,index) in 4" :key="index"></span>
            </div>
        </div>
        <!--  -->
        <div class="homeSection">
            <div class="product"  data-aos="fade-up"  data-aos-once='true'>
                <div class="product-head">
                    <div class="product-head-l">
                        <p>Product New trend</p>
                        <h1>产品新动向</h1>
                    </div>
                    <div class="product-head-r">
                        <span>4/{{ swiper2Index+1 }}</span>
                        <div class="left" :class="[swiper2Index>0?'btnActive':'']" @click="changePre2">←</div>
                        <div class="right" :class="[swiper2Index<3?'btnActive':'']" @click="changeNext2">→</div>
                    </div>
                </div>
                <div class="swiper-container product-banan">
                    <div class="swiper-wrapper">
                        <div class="swiper-slide" v-for="(v,i) in 4" :key="index">
                            <div class="banner-content">
                                <div class="banner-content-left">
                                    <h2>{{ i<9?'0'+(i+1):(i+1) }}</h2>
                                    <h3>超级</h3>
                                    <h1>显微镜</h1>
                                    <p>显示速度高，图像清晰无闪烁，色彩还原性好，使用简单方色彩还原性好，使用简单方</p>
                                </div>
                                <div class="banner-content-right">
                                    <img src="@/assets/img/product1.png" alt="" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="industry" data-aos="fade-up"  data-aos-once='true'>
                <div class="industry-head">
                    <div class="industry-head-l">
                        <p>APPLICATIONS</p>
                        <h1>行业应用</h1>
                    </div>
                    <div class="industry-head-r">
                        更多产品 <span><img src="@/assets/img/youjiantouW.png" alt="" /></span>
                    </div>
                </div>
                <div class="industry-list">
                    <div class="industry-item" v-for="(v,i) in 5" :key="i">
                        <div class="industry-item-bg">
                            <img src="@/assets/img/industry1.png" alt="" />
                        </div>
                        <div class="industry-item-content">
                            <h1>科学研究</h1>
                            <p>ShenZhen YANGWNG Technology company</p>
                            <div class="next"><img src="@/assets/img/youjiantou.png" alt="" /></div>
                        </div>
                        
                    </div>
                </div>
            </div>
            <div class="new" data-aos="fade-up"  data-aos-once='true'>
                <div class="new-head">
                    <p>Corporate news</p>
                    <h1>企业新闻</h1>
                </div>
                <div class="new-list">
                    <div class="new-item" v-for="(v,i) in 2" :key="i">
                        <div class="new-item-l">
                            <img src="@/assets/img/new1.png" alt="" />
                        </div>
                        <div class="new-item-r">
                            <div class="new-itemR-head">
                                <span class="head-new">New</span>
                                <span class="head-next"><img src="@/assets/img/youjiantou.png" alt=""/></span>
                            </div>
                            <div class="new-itemR-time">
                                2022-09-08
                            </div>
                            <p>恭贺仰望科技2018年会盛宴圆望科技2018年会盛宴圆</p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="serve" data-aos="fade-up"  data-aos-once='true'>
                <div class="serve-bg">
                    <img src="@/assets/img/serve-bg.png" alt="">
                </div>
                <div class="serve-content">
                    <div class="serve-l">
                        <img src="@/assets/img/logo.png" alt="" />
                    </div>
                    <div class="serve-r">
                        <h1>用科技服务大众 为客户量身定制</h1>
                        <p>ShenZhen YANGWANG Technology company</p>
                    </div>
                </div>
                
            </div>
        </div>
    </div>
</template>
<script>

export default {
    name:'home',
    data(){
        return{
            swipers:{},
            swiper2:{},
            swiperIndex:0,
            swiper2Index:0,
            textBookIndex:0,
            changeShow:true,
        }
    },
    mounted(){
        
        let that = this;
        
        this.swipers = new Swiper('.banan', {
            autoplay: false,
            delay:5000,
            loop:true,
            on:{
                slideChangeTransitionEnd:function(){
                    that.swiperIndex = this.realIndex;
                    console.log(this.realIndex,that.swiperIndex)
                }
            }
            // direction: "horizontal",
	    	// loop: true,
	    	// observer: true,
	    	// observeParents: true,
            
        });
        this.swiper2 = new Swiper('.product-banan', {
	    	loop: false,
            delay:8000,
            // autoplay:true,
	    	slidesPerView: "auto",
            slidesPerView : 2,
            spaceBetween: 80,
            on:{
                slideChangeTransitionEnd(swiper){
                    console.log(swiper.activeIndex)
                    that.$nextTick(()=>{
                        that.swiper2Index = swiper.activeIndex
                    })
                    
                }
            }
        });
        
    },
    methods:{
        changeTextBook(n){
            if(this.textBookIndex==n) return false;
            this.textBookIndex = n
            this.changeShow = false;
            setTimeout(() => {
                this.changeShow = true;
            }, 100);
        },
        changePre1(){
            this.swipers.slidePrev()
        },
        changeNext1(){
            this.swipers.slideNext()
        },
        changePre2(){
            this.swiper2.slidePrev()
        },
        changeNext2(){
            this.swiper2.slideNext()
            
        },
    }
}
</script>
<style lang="scss">
.homeMain{
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    .banan{
        width: 100%;
        height: r(1079);
        position: relative;
        overflow: hidden;
        .swiper-slide{
            width: 100%;
            height: 100%;
            position: relative;
            img{
                width: 100%;
                height: 100%;
            }
            .banner-content{
                position: absolute;
                top: r(328);
                left: r(150);
                display: flex;
                .banner-content-left{
                    h2{
                        line-height: r(86.88);
                        font-size: r(60);
                        font-weight: 400;
                        color: #fff;
                    }
                    h1{
                        font-size: r(90);
                        line-height: r(130.32);
                        color: #fff;
                    }
                    p{
                        line-height: r(54);
                        font-size: r(30);
                        color:#F7F9FC;
                        padding: r(61) 0 r(122);
                        width: r(573);
                        word-break:keep-all;
                    }
                    .banner-content-detail{
                        width: r(240);
                        height: r(60);
                        line-height: r(60);
                        color: #F4F7FD;
                        font-size: r(28);
                        background-color: #E15100;
                        text-indent: r(42);
                        letter-spacing: r(2);
                        span{
                            font-size: r(20);
                            padding-left: r(17);
                        }
                    }
                }
                .banner-content-right{
                    position: absolute;
                    top:  r(-328);
                    left: r(403);
                    width: r(1357.64);
                    height: r(1080);
                    img{
                        // background-color: rgba(59, 205, 13, .3);
                    }
                }
            }
        }
        .swiper-pag{
            position: absolute;
            left:r(165);
            bottom: r(60);
            display: flex;
            align-items: center;
            z-index: 8;
            span{
                width: r(9);
                height: r(9);
                background-color: #fff;
                margin-right: r(28);
                border-radius: 50%;
            }
            .pagActive{
                background: #E15100;
            }
        }
    }
    .homeSection{
        width: 100%;
        background-color:#F0F4FA;
        .product{
            width: 100%;
            height: r(1080);
            background-image: url('../../assets/img/product_bg.png');
            background-repeat: no-repeat;
            background-position:r(601) 0;
            background-size: auto 100%;
            padding-left: r(150);
            box-sizing: border-box;
            // 
            overflow: hidden;
            &-head{
                width: 100%;
                display: flex;
                justify-content: space-between;
                align-items: flex-end;
                padding-right: r(51);
                box-sizing: border-box;
                &-l{
                    p{
                        line-height: r(43.44);
                        font-size: r(30);
                        color: #E15100;
                        padding: r(100) 0 r(7);
                    }
                    h1{
                        font-size: r(70);
                        color:#273443;
                        line-height: r(101.36);
                        font-weight: 700;
                    }
                }
                &-r{
                    display: flex;
                    align-items: center;
                    margin-bottom: r(20);
                    span{
                        font-size: r(26);
                        line-height: r(42);
                        color: rgba(0,0,0,.5);
                        
                    }
                    .left{
                        width: r(60);
                        height: r(60);
                        border: r(1) solid #E15100;
                        font-size: r(25);
                        color: #E15100;
                        margin: 0 r(35) 0 r(34);
                        text-align: center;
                        line-height: r(60);
                        cursor: pointer;
                    }
                    .right{
                        width: r(60);
                        height: r(60);
                        border: r(1) solid #E15100;
                        font-size: r(25);
                        color: #E15100;
                        text-align: center;
                        line-height: r(60);
                        cursor: pointer;
                    }
                    .btnActive{
                        background: #E15100;
                        color: #fff;
                    }
                }
            }
            &-banan{
                width:100%;
                height: r(592);
                overflow: hidden;
                margin-top: r(70);
                .swiper-slide{
                    width: r(860);
                    height: 100%;
                    background-color: #fff;
                    .banner-content{
                        width: 100%;
                        height: 100%;
                        position: relative;
                        &-left{
                            width: r(378);
                            margin-left: r(40);
                            h2{
                                font-size: r(46);
                                line-height: r(66.61);
                                color: #E15100;
                                font-weight: 900;
                                padding: r(33) 0 0 0;
                            }
                            h3{
                                line-height: r(81.09);
                                font-size: r(56);
                                font-weight: 300;
                                margin: r(108) 0 0;
                                color: #273443;
                            }
                            h1{
                                line-height: r(81.09);
                                font-size: r(56);
                                font-weight: 300;
                            }
                            p{
                                width: 100%;
                                margin-top: r(54);
                                font-size: r(26);
                                color:rgba(0,0,0,.5);
                                line-height: r(42);
                                display: -webkit-box;
                                line-clamp: 2;
                                -webkit-line-clamp: 2;
                                -webkit-box-orient: vertical;
                                text-overflow: ellipsis;
                                overflow: hidden;

                            }
                        }
                        &-right{
                            position: absolute;
                            top: r(88);
                            right: 0;
                            width: r(457);
                            height: r(422);
                        }
                    }
                }
            }
        }
        .industry{
            width: 100%;
            background-color: #fff;
            height: r(1080);
            padding-left: r(150);
            box-sizing: border-box;
            &-head{
                width:100%;
                display: flex;
                align-items: flex-end;
                justify-content: space-between;
                padding-right: r(59);
                box-sizing: border-box;
                &-l{
                    p{
                        line-height: r(43.44);
                        font-size: r(30);
                        font-weight: 700;
                        padding: r(100) 0 r(7);
                    }
                    h1{
                        line-height: r(101.36);
                        font-size: r(70);
                        color: #273443;
                    }
                }
                &-r{
                     width: r(220);
                     height: r(60);
                     line-height: r(60);
                     text-indent:r(32);
                     display: flex;
                     align-items: center;
                     margin-bottom: r(20);
                     background-color: #E15100;
                     color: #F7FCFF; 
                     font-size: r(25);
                     cursor: pointer;
                     span{
                        width: r(52);
                        margin-left: r(15);
                         img{
                            display: block;
                            width: 100%;
                         }  
                     }
                }
            }
            &-list{
                width: 100%;
                height: r(651);
                overflow-y: hidden;
                overflow-x: auto;
                white-space: nowrap;
                margin-top: r(70);
                .industry-item{
                    width: r(415.95);
                    height: 100%;
                    display: inline-block;
                    vertical-align: top;
                    position: relative;
                    background-color: #273443;
                    margin-right: r(50);
                    overflow: hidden;
                    cursor: pointer;
                    &-content{
                        position: absolute;
                        top: r(59.91);
                        left: r(49.69);
                        z-index: 2;
                        h1{
                            font-size: r(52);
                            line-height: r(75.3);
                            color: #fff;
                            font-weight: 700;
                            letter-spacing: r(3);
                        }
                        p{
                            font-size: r(26);
                            line-height: r(39);
                            font-weight: r(300);
                            color: rgba(255,255,255,.5);
                            width: r(280.67);
                            margin-bottom: r(72.87);
                        }
                        .next{
                            width: r(66.26);
                            color: #E15100;
                        }
                    }
                    
                    &-bg{
                        position: absolute;
                        bottom: 0;
                        right: 0;
                        width: r(363);
                        height: r(393);
                        img{
                            width: 100%;
                            height: 100%;
                        }
                    }
                }
            }
        }
        .new{
            width: 100%;
            background: #F0F4FA;
            padding: r(100) r(150) r(80);
            box-sizing: border-box;
            &-head{
                p{
                    font-size: r(30);
                    color: #E15100;
                    line-height: r(43);
                }
                h1{
                    font-size: r(70);
                    line-height: r(101);
                    margin: r(7) 0 r(50.37);
                    color: #273443;
                }
            }
            &-list{
                width: 100%;
                display: flex;
                align-items: center;
                justify-content: space-between;
                .new-item{
                    width:r(786);
                    height: r(214);
                    background-color: #fff;
                    display: flex;
                    cursor: pointer;
                    &-l{
                        width: r(257.67);
                        height: r(214);
                    }
                    &-r{
                        width: r(455.8);
                        margin-left: r(24.9);
                        .new-itemR-head{
                            display: flex;
                            align-items: center;
                            justify-content: space-between;
                            padding: r(22) 0 r(33);
                            .head-new{
                                width:r(87.69);
                                height: r(28);
                                background: url('../../assets//img/juxing.png') no-repeat;
                                background-size: 100% 100%;
                                font-size: r(20);
                                line-height: r(28);
                                text-indent: r(21.65);
                                color:#fff;
                            }
                            .head-next{
                                width: r(56);
                            }
                        }
                        .new-itemR-time{
                            font-size: r(32);
                            line-height: r(46);
                            color: #273443;
                            font-weight: bold;
                        }
                        p{
                          line-height: r(46);
                          font-size: r(32);
                          color:#273443; 
                          opacity: 0.5;
                          white-space: nowrap;
                          text-overflow: ellipsis;
                          overflow: hidden; 
                          margin-top: r(14);
                          width: r(450);
                        }
                    }
                }
            }
        }
        .serve{
            width: 100%;
            height: r(353);
            position: relative;
            &-bg{
                width: 100%;
                height: 100%;
                position: relative;
                img{
                    width: 100%;
                    height: 100%;
                }
            }
            &-bg::before{
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                display: block;
                content: "";
                z-index: 1;
                background: linear-gradient(45deg,#25487A,rgba(68,132,224,0));
            }
            .serve-content{
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                display: flex;
                align-items: center;
                z-index: 2;
                .serve-l{
                    width: r(146);
                    height: r(146);
                    margin-left: r(167);
                    background-color: #fff;
                    border-radius: 50%;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    img{
                        width: r(122.45);
                    }
                }
                .serve-r{
                    margin-left: r(65);
                    h1{
                        line-height: r(101);
                        font-size: r(70);
                        font-weight: bold;
                        color: #F7F9FC;
                    }
                    p{
                        margin-top: r(9);
                        line-height: r(45);
                        color: #F7F9FC;
                        font-size: r(30);
                    }
                }
            }
            
        }
    }
}
@keyframes rotaes{
    0%{transform:rotateY(0)}
    100%{transform:rotateY(180deg)}
}
</style>